//
//  DataHeaderView.m
//  LiveSoftware
//
//  Created by lanou3g on 15/7/17.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "FootballTeamOrderHeaderView.h"
#define kFootballTeamOrderFont 13

@implementation FootballTeamOrderHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        
        
        self.headerBg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenIp6(30))];
        self.headerBg.image = [UIImage imageNamed:@"header_view_bg"];
        [self addSubview:_headerBg];
        // 间隙
        CGFloat labelH = kScreenIp6(30);
        CGFloat labelW1  = kScreenIp6(40);
        CGFloat labelW2 = kScreenIp6(50);
        CGFloat labelW = (kScreenWidth - labelW1 - labelW2 - labelW1 - kScreenIp6(125) )/4;
        self.team_order = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, labelW1 ,labelH)];
        self.team_order.text = @"排名";
        _team_order.textAlignment = NSTextAlignmentCenter;
        //        _team_order.backgroundColor = [UIColor redColor];
        _team_order.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        [self.headerBg addSubview:_team_order];
        
        
        
        
        self.team_cn = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_team_order.frame), 0, kScreenIp6(125),labelH)];
        //        _team_cn.backgroundColor = [UIColor redColor];
        self.team_cn.adjustsFontSizeToFitWidth = YES;
        self.team_cn.textAlignment = NSTextAlignmentCenter;
        _team_cn.text = @"球队";
        _team_cn.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        [self.headerBg addSubview:_team_cn];
        
        
        self.count = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_team_cn.frame), 0, labelW,labelH )];
        _count.textAlignment = NSTextAlignmentCenter;
        self.count.text = @"场";
        //        _count.backgroundColor = [UIColor redColor];
        _count.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        
        [self.headerBg addSubview:_count];
        
        self.win = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_count.frame), 0, labelW ,labelH )];
        self.win.text = @"胜";
        //        _win.backgroundColor = [UIColor redColor];
        self.win.textAlignment = NSTextAlignmentCenter;
        _win.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        
        [self.headerBg addSubview:_win];
        
        self.draw = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_win.frame), 0, labelW ,labelH )];
        self.draw.text = @"平";
        
        //        _draw.backgroundColor = [UIColor redColor];
        
        _draw.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        _draw.textAlignment = NSTextAlignmentCenter;
        
        [self.headerBg addSubview:_draw];
        
        self.lose = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_draw.frame), 0, labelW ,labelH )];
        self.lose.text = @"负";
        
        //        _lose.backgroundColor = [UIColor redColor];
        _lose.textAlignment = NSTextAlignmentCenter;
        _lose.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        
        [self.headerBg addSubview:_lose];
        
        self.goalAndLosegoal = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_lose.frame), 0, labelW2  ,labelH )];
        self.goalAndLosegoal.text = @"进/失";
        
        //        _goalAndLosegoal.backgroundColor = [UIColor redColor];
        _goalAndLosegoal.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        _goalAndLosegoal.textAlignment = NSTextAlignmentCenter;
        
        [self.headerBg addSubview:_goalAndLosegoal];
        
        self.score = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_goalAndLosegoal.frame), 0, labelW1 ,labelH )];
        //        _score.backgroundColor = [UIColor redColor];
        self.score.text = @"积分";
        
        _score.textAlignment = NSTextAlignmentCenter;
        _score.font = [UIFont systemFontOfSize:kFootballTeamOrderFont];
        
        [self.headerBg addSubview:_score];
        
        
        
        
        
    }
    return self;
}

@end
